package com.wscx.jingjie.util;

import com.alibaba.fastjson.JSONObject;

public class ResultUtil {

    public static JSONObject setJson(int code, String msg) {
        JSONObject resultJson = new JSONObject();
        resultJson.put("code", code);
        resultJson.put("msg", msg);
        resultJson.put("data", null);
        return resultJson;
    }
    public static JSONObject setJson(int code, String msg, Object info) {
        JSONObject resultJson = new JSONObject();
        resultJson.put("code", code);
        resultJson.put("msg", msg);
        resultJson.put("data", info);
        return resultJson;
    }
    public static JSONObject setData(Object info){
        JSONObject resultJson = new JSONObject();
        resultJson.put("code", 0);
        resultJson.put("msg", "");
        resultJson.put("data", info);
        return resultJson;
    }
}
